﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//弯曲形状加热条

namespace GraphConfigTool
{
    public class CurvedHeaterStrip
    {
        public Point point1;
        public Point point2;
        public Point point3;
        public Point point4;
        public Point[] points;
        public int value = 150;//数值 瓦数
        public string unit = "W";//单位
        public Point nameLocation;
        public int height = 20;
        public int width = 40;
        public int lineWidth = 8;//线条宽度
        public Color nameColor;//名称的颜色  value + unit
        public Color penColor;
        public Font font = new Font("宋体", 10);
        public int type;
        public bool configAddressFlag = false;//该加热条是否配置地址标记
        public int dialNumber;//拨码号
        public int location;//引线位置


        public CurvedHeaterStrip()
        {
            //画笔初始化
            //pen = new Pen(Color.FromArgb(28, 134, 238), this.lineWidth);
            penColor = Color.FromArgb(205, 0, 205);
            nameColor = Color.Black;
        }

        public CurvedHeaterStrip(Color color, int width)
        {

        }
        //计算点位 只适用于初始化条件
        public void calculatePoint(Point point)
        {
            if (point1 != null)
            {
                point1 = point;
                point2 = new Point(point.X, point.Y + height);
                point3 = new Point(point2.X + width, point2.Y);
                point4 = new Point(point3.X, point1.Y);
            }
        }

        public void addPoints()
        {
            points = new Point[] { this.point1, this.point2, this.point3, this.point4 };//计算完 直接加入集合
        }
    }
}
